<template>
  <div id="menu_app">
    <div id="bts_app">
      <el-button type="primary" round plain>新增</el-button>
    </div>
    <el-table
      :data="menuList"
      style="width: 100%; margin-bottom: 20px"
      row-key="id"
    >
      <el-table-column prop="id" label="编号"> </el-table-column>
      <el-table-column prop="title" label="标题菜单"> </el-table-column>
      <el-table-column prop="icon" label="菜单图标">
          <template  v-slot="$props">
          <i :class="$props.row.icon"></i>
        
          </template>
           </el-table-column>
      <el-table-column prop="url" label="菜单地址"> </el-table-column>
      <el-table-column prop="status" label="菜单状态"> 
            <template  v-slot="$props">
         <el-button type="warning" round plain size='mini' v-if="$props.row.status==1">正常</el-button>
         <el-button type="warning" round plain size='mini' v-else>禁止</el-button>
          </template>
      </el-table-column>
      <el-table-column prop="name" label="操作"> 
           <el-button type="warning" round plain size='mini'>编辑</el-button>
            <el-button type="danger" round plain size='mini'>删除</el-button>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import {mapActions, mapState} from 'vuex'
export default {
  data() {
    return {
      
      tableData: [  ],
    };
  },
  computed:{
      ...mapState('menu_model',['menuList'])
  },
  methods:{
      ...mapActions('menu_model',['menuListActions']),
   
  },
  created(){
      this.menuListActions()
      
  }
};
</script>

<style >
#bts_app {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}
#menu_app .el-table {
  line-height: 0;
}

.el-table__header thead,
.el-table__header thead th {
  background-color: #ff674b;
  color: #fff;
  line-height: 40px;
  border: 0;
}
</style>